package cn.zhuangcloud.word.object;

import cn.zhuangcloud.word.object.unit.IUnitPart;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Unit {

    private List<IUnitPart> parts = new ArrayList<IUnitPart>();
    private String name;

    public Unit(IUnitPart[] unitParts, String name) {
        this.name = name;
        parts.addAll(Arrays.asList(unitParts));
        /*for(IUnitPart unit:unitParts){
            parts.put(unit.getType(),unit);
        }*/
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<IUnitPart> getParts() {
        return parts;
    }

    public void setParts(List<IUnitPart> parts) {
        this.parts = parts;
    }
}
